perf: lazy load signIn home-background assets#69751
Conversation
|
@dubielzyk-expensify @ZhenjaHorbach One of you needs to copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
|
Can we see videos of this in action? Thanks! |
|
@LukasMod |
|
Perf PR, doesn’t have any new product considerations. Removing the tag and unsubscribing myself. |
|
@shawnborton I added a video in the macOS web section simulating a slow internet connection. There’s a fading animation on the background component, so with a normal internet speed, the difference isn’t noticeable. @ZhenjaHorbach Feel free if you have any suggestions |
Reviewer Checklist
Screenshots/VideosAndroid: HybridApp2025-09-05.11.50.52.movAndroid: mWeb Chrome2025-09-05.11.50.09.moviOS: HybridApp2025-09-05.11.48.04.moviOS: mWeb Safari2025-09-05.11.46.30.movMacOS: Chrome / Safari2025-09-05.11.37.52.movMacOS: Desktop2025-09-05.12.00.21.mov |
|
Hmm I can't really tell what's happening in your video - maybe you can show a fresh reload on the slow connection? |
|
@shawnborton The problem earlier was that when entering SignIn, the image for large/small screens was immediately being loaded. By the time the splash screen disappears on the first entry, it was already downloaded (previously, both images). Now, the loading is separated depending on whether we have a large or small screen. In the video, you can see that the package with the description 131-d6a... (the image for large screens) is loaded separately only after the window is enlarged. After loaded, the background (building outlines) appears. There is a slight delay in this slow connection case compared to the rest (like hands/text), which is reused for both variants. This is the best case where I was actually able to notice any difference after this change from the user's perspective. Let me know if this explanation helps. Let me know if this explanation helps. If not, I will try making another video as suggested 👍 |
|
That makes sense but in order to properly review the PR, it would be great to see a video of how a user on a slow connection would experience going to new.expensify.com - can you show us please? Thanks! |
|
@shawnborton I added new video to web section, with refresh for slow connection (Slow4G) |
|
As for me, everything looks good ! |
|
@shawnborton I analyzed the issue and looked into what might be causing this effect, and it’s not entirely obvious. In general, there’s no element that would directly cause it or be responsible for the rectangle itself. The area that sets the color applies it to almost the entire view, and it’s not a gradient. Even if we disable the entire image, the effect remains, and the slight difference is still there—the image just fits into that space with its background/opacity and effectively hides it. For testing, below is the production page with the image disabled for both the current color and the fake one #672519. For the current color, I cropped a section and compared the colors with a picker: They are #72519 and #92519, while the color set in the code is #72419 - which is strange to me. I tend to think this is some effect directly caused by the color itself and how it’s rendered by the browser. The effect occurs regardless of the presence of a background image or fadeIn animation, and it exists specifically for this color. There is no such effect If I change color to fake one: By the way, on both of my screens, even at maximum brightness, it’s barely noticeable. It only becomes slightly more visible in recordings, which might again be due to some underlying transformations. Alternatively, could you verify this directly on the built app rather than through the recording? Most of the time, to verify if it’s visible, I had to use recordings to make it more noticeable. |
…to perf/lazy-loading-home-background
|
@LukasMod @ZhenjaHorbach would this be ready to review/merge now then? |
|
@carlosmiceli From my side yes. |
|
LGTM ! |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚀 Deployed to staging by https://github.com/carlosmiceli in version: 9.2.3-0 🚀
|
|
🚀 Deployed to staging by https://github.com/carlosmiceli in version: 9.2.5-0 🚀
|
|
🚀 Deployed to staging by https://github.com/carlosmiceli in version: 9.2.8-0 🚀
|
|
🚀 Deployed to production by https://github.com/francoisl in version: 9.2.8-4 🚀
|







Explanation of Change
BackgroundImage/index.ios.tsx, remove the unreachable home-background asset for iOS for large screens. TheisSmallScreencondition used inBackgroundImageis derived fromshouldUseNarrowLayout, which for native is always trueuseResponsiveLayout/index.native.ts:BackgroundImage/index.ios.tsxclean up, rename the asset suffix to indicate it is used only for iOS--iosinstead of--mobile-new.Fixed Issues
$ #69860
PROPOSAL:
Tests
Offline tests
QA Steps
Same as tests
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectioncanBeMissingparam foruseOnyxtoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
Video with focus on lazy bundle (Slow4G throttling)
https://github.com/user-attachments/assets/d8d10765-9cce-472c-8370-b70bd8a37443
Video with refresh (Slow4G throttling), recording after ~1,5min of fetching initial bundle to save time/space:
https://github.com/user-attachments/assets/65a72786-96ce-45d8-8d80-9f366f6d20f4
MacOS: Desktop